<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>赋值运算符</title>
</head>

<body>
    <!-- 
        = ：进行赋值操作
        +=：加等于运算符
        -=：减等于运算符
        *=：乘等于运算符
        /=：除等于运算符
        %=：取余等于运算符
     -->
    <script>
        var n1 = 10
        //执行加等于运算
        n1 += 10
        console.log(n1)

        var n5 = 10
        //执行加等于运算
        n5 += n5 + 10
        console.log(n5)//结果30
        var n2 = 10
        //执行减等于运算
        n2 -= 10
        console.log(n2)

        var n3 = 10
        //执行乘等于运算
        n3 *= 10
        console.log(n3)

        var n4 = 10
        //执行除等于运算
        n4 /= 10
        console.log(n4)

        var n6 = 10
        //执行取余等于运算
        n6 %= 3
        console.log(n6)
    </script>
</body>

</html>